//
//  UserProBtn.m
//  AILock
//
//  Created by 谭亚明 on 2020/7/17.
//  Copyright © 2020 tym. All rights reserved.
//

#import "UserProBtn.h"
#import "UIButton+Gradient.h"
@implementation UserProBtn

-(void)awakeFromNib{
    [super awakeFromNib];
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = 5;
    [self.titleLabel setFont:Font_Regular(12)];
}

-(void)setSelected:(BOOL)selected{
    if (selected) {
        self.layer.borderWidth = 0;
        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [self gradientButtonWithSize:self.bounds.size colorArray:@[(id)rgba(139, 175, 255),(id)rgba(76, 132, 255)] percentageArray:@[@(0.5),@(1)] gradientType:GradientFromLeftTopToRightBottom];
    }else{
        [self setTitleColor:rgba(53, 54, 70) forState:UIControlStateNormal];
        self.layer.borderColor = rgba(151, 151, 151).CGColor;
        self.layer.borderWidth = 1;
        self.backgroundColor = [UIColor whiteColor];
        [self gradientButtonWithSize:self.frame.size colorArray:@[[UIColor whiteColor],[UIColor whiteColor]] percentageArray:@[@(0.5),@(1)] gradientType:GradientFromLeftTopToRightBottom];
    }
}

@end
